package com.foo.common.base.utils;

import java.io.IOException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.base.Preconditions;

/**
 * 绝大多数只需要编译class的项目，使用该类即可
 * 
 * @author Steve
 *
 */
public class ClassCompileHelper {
	static Logger logger = LoggerFactory.getLogger(ClassCompileHelper.class);

	public static void main(String[] args) throws IOException {
		Preconditions.checkArgument(args.length == 1);
		// String workingDirectoryName = "2014-10-08-zgzxInterface";
		String workingDirectoryName = args[0];
		FooClassCompileHelper classHelper = FooClassCompileHelper
				.custom()
				.setWorkingDirectory(
						"D:\\tmp\\itms\\" + workingDirectoryName + "\\")
				.setSourceDirectory(
						"D:\\programTool\\myGit\\ims\\itmsPlus_Core\\target\\classes")
				.build();
		int result = classHelper.compileAndCopyClass();
		logger.info("finished with result:{}", result);
	}

}